package Shell;

import java.util.ArrayList;

public class Directory {
	
	private String dirName;
	private Directory parent = null;
	private ArrayList<Directory> dirList = new ArrayList<Directory>();
	private ArrayList<File> fileList = new ArrayList<File>();
	
	
	public Directory(String dirName) {
		this.dirName = dirName;
	}


	/**
	 * @return the dirList
	 */
	public ArrayList<Directory> getDirList() {
		return dirList;
	}


	/**
	 * @param dirList the dirList to set
	 */
	public void setDirList(Directory dirList) {
		this.dirList.add(dirList);
	}


	/**
	 * @return the fileList
	 */
	public ArrayList<File> getFileList() {
		return fileList;
	}


	/**
	 * @param fileList the fileList to set
	 */
	public void setFileList(File fileList) {
		this.fileList.add(fileList);
	}


	/**
	 * @return the dirName
	 */
	public String getDirName() {
		return dirName;
	}


	public Directory getParent() {
		return parent;
	}


	public void setParent(Directory parent) {
		this.parent = parent;
	}
	
	public String getPath() {
		if(parent == null)
			return "/";
		
		return parent.getPath()+"/"+dirName;
	}
	
}
